package at.guigu.controller;

import at.guigu.exception.MyException;
import at.guigu.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import java.io.FileNotFoundException;

@Controller
@RequestMapping("/user")
public class UserController {
    @Autowired
    private UserService userService;
    @RequestMapping("/show1")
    public String save1() {
        System.out.println("save1 running...");
        userService.show1();
        return "success";
    }
    @RequestMapping("/show2")
    public String save2() {
        System.out.println("save2 running...");
        userService.show2();
        return "success";
    }
    @RequestMapping("/show3")
    public String save3() throws FileNotFoundException {
        System.out.println("save3 running...");
        userService.show3();
        return "success";
    }
    @RequestMapping("/show4")
    public String save4() {
        System.out.println("save4 running...");
        userService.show4();
        return "success";
    }
    @RequestMapping("/show5")
    public String save5() throws MyException {
        System.out.println("save5 running...");
        userService.show5();
        return "success";
    }

}